package com.training.content.service.impl;

import java.util.List;
import com.training.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.training.content.mapper.ExamSubjectOptionsMapper;
import com.training.content.domain.ExamSubjectOptions;
import com.training.content.service.IExamSubjectOptionsService;

/**
 * 试卷题目答案选项Service业务层处理
 * 
 * @author training
 * @date 2021-10-25
 */
@Service
public class ExamSubjectOptionsServiceImpl implements IExamSubjectOptionsService 
{
    @Autowired
    private ExamSubjectOptionsMapper examSubjectOptionsMapper;

    /**
     * 查询试卷题目答案选项
     * 
     * @param optionsId 试卷题目答案选项主键
     * @return 试卷题目答案选项
     */
    @Override
    public ExamSubjectOptions selectExamSubjectOptionsByOptionsId(Long optionsId)
    {
        return examSubjectOptionsMapper.selectExamSubjectOptionsByOptionsId(optionsId);
    }

    /**
     * 查询试卷题目答案选项列表
     * 
     * @param examSubjectOptions 试卷题目答案选项
     * @return 试卷题目答案选项
     */
    @Override
    public List<ExamSubjectOptions> selectExamSubjectOptionsList(ExamSubjectOptions examSubjectOptions)
    {
        return examSubjectOptionsMapper.selectExamSubjectOptionsList(examSubjectOptions);
    }

    /**
     * 新增试卷题目答案选项
     * 
     * @param examSubjectOptions 试卷题目答案选项
     * @return 结果
     */
    @Override
    public int insertExamSubjectOptions(ExamSubjectOptions examSubjectOptions)
    {
        examSubjectOptions.setCreateTime(DateUtils.getNowDate());
        return examSubjectOptionsMapper.insertExamSubjectOptions(examSubjectOptions);
    }

    /**
     * 修改试卷题目答案选项
     * 
     * @param examSubjectOptions 试卷题目答案选项
     * @return 结果
     */
    @Override
    public int updateExamSubjectOptions(ExamSubjectOptions examSubjectOptions)
    {
        examSubjectOptions.setUpdateTime(DateUtils.getNowDate());
        return examSubjectOptionsMapper.updateExamSubjectOptions(examSubjectOptions);
    }

    /**
     * 批量删除试卷题目答案选项
     * 
     * @param optionsIds 需要删除的试卷题目答案选项主键
     * @return 结果
     */
    @Override
    public int deleteExamSubjectOptionsByOptionsIds(Long[] optionsIds)
    {
        return examSubjectOptionsMapper.deleteExamSubjectOptionsByOptionsIds(optionsIds);
    }

    /**
     * 删除试卷题目答案选项信息
     * 
     * @param optionsId 试卷题目答案选项主键
     * @return 结果
     */
    @Override
    public int deleteExamSubjectOptionsByOptionsId(Long optionsId)
    {
        return examSubjectOptionsMapper.deleteExamSubjectOptionsByOptionsId(optionsId);
    }
}
